//
//  CollectionView.swift
//  MD5
//
//  Created by 郑东喜 on 2016/11/24.
//  Copyright © 2016年 郑东喜. All rights reserved.
//

import UIKit

class CollectionView: UICollectionViewCell {
    let width = UIScreen.main.bounds.size.width//获取屏幕宽
    var titleLabel:UIButton?//title
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        initView()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func initView(){
//        titleLabel = UILabel(frame: CGRectMake(5, 5, (width-40)/2, 50))
        titleLabel = UIButton(frame: CGRect(x: 5, y: 5, width: (width - 40) / 2, height: 50))
        
        titleLabel?.layer.borderWidth = 1
        titleLabel?.layer.backgroundColor = UIColor.black.cgColor
        titleLabel?.backgroundColor = UIColor.gray
        self .addSubview(titleLabel!)
    }
}
